package com.iversonx.example_1.controller.v2;

import com.iversonx.example_1.controller.AwardReq;
import com.iversonx.example_1.controller.AwardRes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class PrizeControllerV2 {
    @Autowired
    private PrizeServiceFactory prizeServiceFactory;
    public AwardRes awardToUser(AwardReq req) throws Exception {
        PrizeService prizeService = prizeServiceFactory.getPrizeService(req.getAwardType());
        prizeService.sendCommodity(req);
        return new AwardRes("0000", "发放成功");
    }
}
